package com.example.demo.config;

import lombok.Data;

@Data
public class RestData {
    private int code;
    private String msg;
    private Object data;

    public static RestData success(Object data) {
        RestData restData = new RestData();
        restData.setCode(200);
        restData.setMsg("请求成功");
        restData.setData(data);
        return restData;
    }

    public static RestData error(Object data) {
        RestData restData = new RestData();
        restData.setCode(500);
        restData.setMsg("请求失败");
        restData.setData(data);
        return restData;
    }

}
